package ru.kantiana.accounting.rldata.core.bazaok.data;

import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;

/**
 * @author: Pavel Belevich
 * Date: 4/2/11
 * Time: 11:10 PM
 */
public class BODocumentBuilderImpl implements BODocumentBuilder {
    public Document buildDocument(BOEntry boEntry) {
        Document document = new Document();
        document.add(new Field("number", boEntry.getNumber(), Field.Store.YES, Field.Index.NOT_ANALYZED));
        document.add(new Field("name", boEntry.getName(), Field.Store.YES, Field.Index.ANALYZED));
        document.add(new Field("text", boEntry.getText(), Field.Store.YES, Field.Index.NO));
        return document;
    }
}
